package com.wd.elec.utils;

import java.util.Properties;

/**
 * @className: CommonUtil
 * @description: TODO 类描述
 * @author: liumingkun
 * @date: 2024/7/3
 **/
public class CommonUtil {

    public static boolean isOSLinux() {
        Properties prop = System.getProperties();
        String os = prop.getProperty("os.name");
        if (os != null && os.toLowerCase().indexOf("linux") > -1) {
            return true;
        } else {
            return false;
        }
    }

    /**
     * 获取二维码图片的路径
     *
     * @return
     */
    public static String getPath(String path) {
        if (isOSLinux()) {
            return path;
        } else {
            return System.getProperty("user.dir") + path;
        }
    }
}
